package com.jrx.anytxn.param.mapper.ext;

import com.jrx.anytxn.common.annotation.ParamTuningAnnotation;
import com.jrx.anytxn.param.entity.PrPromotionInfo;
import com.jrx.anytxn.param.mapper.base.PrPromotionInfoMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 张靖烽
 * @name ExtPrPromotionInfoMapper
 * @description 促销活动信息表mapper
 * @createtime 2020-12-09 10:54
 */
public interface ExtPrPromotionInfoMapper extends PrPromotionInfoMapper {

    /**
     * 根据租户Id查询所有促销活动信息
     *
     * @param tenantId 租户ID
     * @createtime 2020-12-09 10:57
     * @return List<PrPromotionInfo>
     */
    List<PrPromotionInfo> selectByTenId(String tenantId);

    /**
     * 根据活动Id和租户Id查询促销活动信息
     *
     * @param tenantId 租户ID
     * @param promotionId 活动ID
     * @createtime 2020-12-09 10:57
     * @return PrPromotionInfo
     */
    PrPromotionInfo selectByPromotionIdAndTenId(@Param("promotionId") String promotionId, @Param("tenantId") String tenantId);

    /**
     * 根据活动Id和租户Id编辑
     *
     * @param prPromotionInfo 促销活动信息表
     * @createtime 2020-12-09 10:57
     */
    @ParamTuningAnnotation
    void updateByPromotionIdAndTenId(PrPromotionInfo prPromotionInfo);

    /**
     * 根据活动Id和租户Id删除促销活动信息
     *
     * @param tenantId 租户ID
     * @param promotionId 活动ID
     * @createtime 2020-12-09 10:57
     * @return int
     */
    @ParamTuningAnnotation
    int deleteByPromotionIdAndTenId(@Param("promotionId") String promotionId, @Param("tenantId") String tenantId);
}